/**
* @author AlbertDarren
* @contact 2563491540@qq.com
*/
#include <iostream>
#include <vector>
#include <list>
#include <deque>
#include <string>
#include <cstdlib>
#include <ctime>
using namespace std;
void show(auto container,string sep=" ")
{
    for(auto ele:container)
    {
        cout << ele << sep;
    }
    cout << endl;
}
int main_12()
{
    srand((unsigned int)time(nullptr));
    string names[] {"Alice","Bob","Cindy","Eric","Franck","Gloria","Henry","Jackson","Linda","Mary"};
    vector<string> str_vect;
    list<string> str_list;
    deque<string> str_deq;
    int idx,name_num=sizeof(names)/sizeof(names[0]);
    for (int i=0; i<5 ; ++i )
    {
        idx=rand()%name_num;
        str_vect.push_back(names[idx]);
        str_list.push_back(names[idx]);
        str_list.push_front(names[idx]);
        str_deq.push_back(names[idx]);
        str_deq.push_front(names[idx]);
    }
    show(str_vect);
    for (auto iter=str_vect.rbegin(); iter!=str_vect.rend() ; ++iter )
    {
        cout << *iter << " ";
    }
    cout  << endl;
    str_vect.insert(str_vect.begin()+2,"Albert");
    str_vect.insert(str_vect.end()-2,{"Darling","Lover","Honey"});
    show(str_vect);
    show(str_list,",");
    str_list.insert(str_list.end(),2,"Lucy");
    show(str_list,",");
    show(str_deq,"~");
    str_deq.insert(str_deq.begin(),str_vect.begin(),str_vect.end());
    show(str_deq,"~");
    return 0;
}
